# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=deepin-editor
pkgver=6.0.14
pkgrel=1
pkgdesc='Simple editor for Deepin'
arch=('loong64' 'x86_64')
url="https://github.com/linuxdeepin/deepin-editor"
license=('GPL3')
depends=('deepin-qt5integration' 'dtkcore' 'dtkgui' 'dtkwidget' 'deepin-qt-dbus-factory'
         'gcc-libs' 'icu' 'qt5-base' 'qt5-svg'
         'kcodecs5' 'syntax-highlighting5' 'libchardet' 'uchardet')
makedepends=('git' 'cmake' 'gmock' 'gtest' 'ninja' 'qt5-tools')
groups=('deepin-extra')
source=("$pkgname-$pkgver.tar.gz::https://github.com/linuxdeepin/deepin-editor/archive/refs/tags/$pkgver.tar.gz")
sha512sums=('69dde2aa30a3c82033e0586100f39f9525bd236c750119288b73ce71b5b83aed4c886f234f0730bbc7119a72c2695a31e942b4599e3c7a7688ff59eed119bdb8')

build() {
  cd deepin-editor-$pkgver
  cmake -GNinja -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DVERSION=$pkgver .
  ninja
}

check() {
  cd deepin-editor-$pkgver
  # Tests not available unless in debug mode
  #ninja test || echo "Tests failed"
}

package() {
  cd deepin-editor-$pkgver
  DESTDIR="$pkgdir" ninja install
}
